]> dgit.raspbian.org Git - ostree.git/commitdiff
tests/kolainst: Fix failures on container-native FCOS
authorJoseph Marrero Corchado <jmarrero@redhat.com>
Fri, 26 Jun 2026 03:44:19 +0000 (23:44 -0400)
committerJoseph Marrero Corchado <jmarrero@redhat.com>
Fri, 26 Jun 2026 03:51:39 +0000 (23:51 -0400)
On container-native FCOS (F44+), /etc/ostree/remotes.d/ may have no
.conf files since the system uses container-based updates rather than
traditional ostree remotes. This caused test failures:

- staged-deploy.sh and finalization.sh: sed on the unexpanded glob
  '/etc/ostree/remotes.d/*.conf' fails under set -euo pipefail when
  no files match. Fix by iterating with a for loop and guarding with
  test -f.

- itest-remotes.sh: 'ostree remote list' returns empty, hitting
  assert_not_reached. Fix by skipping the test gracefully on systems
  with no remotes configured.

Assisted-by: OpenCode (Claude Opus 4.6)
Signed-off-by: Joseph Marrero Corchado <jmarrero@redhat.com>
tests/kolainst/destructive/finalization.sh
tests/kolainst/destructive/staged-deploy.sh
tests/kolainst/nondestructive/itest-remotes.sh

index 34624f5fa8166c2a0b97d61d0231e5f6d6d67637..e0f0e9076010aad9abae4cbc23a675dccf8e7f8e 100755 (executable)
@@ -8,8 +8,13 @@ prepare_tmpdir
 
 case "${AUTOPKGTEST_REBOOT_MARK:-}" in
   "")
-  # Need to disable gpg verification for test builds
-  sed -i -e 's,gpg-verify=true,gpg-verify=false,' /etc/ostree/remotes.d/*.conf
+  # Need to disable gpg verification for test builds.
+  # On container-native FCOS there may be no remotes.d conf files.
+  for conf in /etc/ostree/remotes.d/*.conf; do
+    if test -f "$conf"; then
+      sed -i -e 's,gpg-verify=true,gpg-verify=false,' "$conf"
+    fi
+  done
   # xref https://github.com/coreos/coreos-assembler/pull/2814
   systemctl mask --now zincati
 
index 184da62cd111216039d3df0c5f16d5c8aed1ec8a..5c54d121cc1dc6f548c9dcf3de47a2cf2734bba5 100755 (executable)
@@ -8,8 +8,13 @@ prepare_tmpdir
 
 case "${AUTOPKGTEST_REBOOT_MARK:-}" in
   "")
-  # Need to disable gpg verification for test builds
-  sed -i -e 's,gpg-verify=true,gpg-verify=false,' /etc/ostree/remotes.d/*.conf
+  # Need to disable gpg verification for test builds.
+  # On container-native FCOS there may be no remotes.d conf files.
+  for conf in /etc/ostree/remotes.d/*.conf; do
+    if test -f "$conf"; then
+      sed -i -e 's,gpg-verify=true,gpg-verify=false,' "$conf"
+    fi
+  done
 
   # Test our generator
   test -f /run/systemd/generator/local-fs.target.requires/ostree-remount.service
index d1fb455b5029acf407c956d98d270719a0aada9b..73ae092bfca26f4968512bd7ac4f205e6e51edf9 100755 (executable)
@@ -12,6 +12,12 @@ trap _tmpdir_cleanup EXIT
 
 ostree remote list > remotes.txt
 if ! test -s remotes.txt; then
+    # On container-native FCOS, there are no ostree remotes — that's expected.
+    # On traditional ostree systems, missing remotes is a real regression.
+    if [ "$(rpmostree_query_json '.deployments[0]."container-image-reference" // empty')" != "" ]; then
+        echo "No ostree remotes found; skipping test on container-native system"
+        exit 0
+    fi
     assert_not_reached "no ostree remotes"
 fi
 date